/**
 * 
 */
package de.dhbw.horb.inf2013.vierFarbenProblem.model.datatypes;

import java.awt.Color;

/**
 * The Class ColoredVertex.
 */
public class ColoredVertex extends Vertex {

	/**
	 * Instantiates a new colored vertex.
	 * 
	 * @param id
	 *            the id
	 */
	public ColoredVertex(int id) {
		super(id);
	}

	/** The color. */
	private Color color;

	/**
	 * Sets the color.
	 * 
	 * @param color
	 *            the new color
	 */
	public void setColor(Color color) {
		this.color = color;
	}

	/**
	 * Gets the color.
	 * 
	 * @return the color
	 * @throws NoColorSetException
	 *             the no color set exception
	 */
	public Color getColor() throws NoColorSetException {
		if (color == null) {
			throw new NoColorSetException();
		}
		return color;
	}

	/**
	 * Checks for color.
	 * 
	 * @return true, if successful
	 */
	public boolean hasColor() {
		return (color != null);
	}
}
